#ifndef __kraw__File_h__
#define __kraw__File_h__

/**
	@file file.h
	@class File
*/

#include <string>

namespace kraw
{
	class File
	{
	public:
		File(const std::string& path, bool bundle = true);
		virtual ~File();
		
		virtual bool open(const char* mode = "rb");
		virtual void close();

		virtual int read(void* buffer, int count);
		virtual int write(const void* buffer, int size, int count);

		virtual long getSize();
		virtual bool exists();

		const std::string& getFullPath();

		std::string load();

	protected:
		bool isOpen;
		FILE* pFile;
		long size;
		std::string path;
		std::string fullPath;
		bool isBundle;
	};
	
	class FilePath
	{
	public:
		FilePath(const std::string& path);

		//void stripLastPathComponent();
		//void stripExtension();
		//std::string lastPathComponent();
		//std::string parent_path();
		std::string extension();

		//void string_extension();
		//void replace_extension();

		std::string string();

	private:
		std::string value;
	};
}

#endif
